﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hiro.Interfaces
{
    /// <summary>
    /// Represents a dependency graph that describes all the dependencies in a given application.
    /// </summary>
    public interface IDependencyMap : IDependencyContainer
    {
        /// <summary>
        /// Gets a value indicating the list of services that can be instantiated by the compiled container
        /// using the current list of available activation points.
        /// </summary>
        /// <value>The list of services that will be instantiated by the container once it has been compiled.</value>
        IEnumerable<IService> AvailableServices { get; }

        /// <summary>
        /// Adds a dependency to the current dependency map and uses the given <paramref name="activationPoint"/>
        /// to realize that dependency.
        /// </summary>
        /// <param name="dependency">The dependency that describes the service to be created.</param>
        /// <param name="activationPoint">The implementation that will instantiate the dependency itself.</param>
        void AddService(IDependency dependency, IActivationPoint activationPoint);

        /// <summary>
        /// Obtains the activation point that will instantiate the given <paramref name="dependency"/>.
        /// </summary>
        /// <param name="dependency">The target service dependency that needs to be activated.</param>
        /// <returns>An <see cref="IActivationPoint"/> instance that will instantiate the service described by the dependency.</returns>
        IActivationPoint GetActivationPoint(IDependency dependency);
    }
}
